<h1>Detail Transaksi</h1>
<div class="list">
    <table cellpadding="0" cellspacing="0">
        <tr class="title">
            <th colspan="2" style="text-align:left;"><strong>DATA PENERIMA</strong></th>
        </tr>
        <tr>
            <td width="170">Kode Transaksi</td>
            <td><?php echo $data['transaction_code']; ?></td>
        </tr>
        <tr>
            <td>Tanggal Transaksi</td>
            <td><?php echo function_lib::convert_datetime($data['transaction_datetime'], 'text', '', ':', 'ina'); ?></td>
        </tr>
        <tr>
            <td>Status</td>
            <td><?php echo $data['status']; ?></td>
        </tr>
        <tr>
            <td>Nama Penerima</td>
            <td><?php echo $data['transaction_recipient_name']; ?></td>
        </tr>
        <tr>
            <td>Alamat Lengkap Pengiriman</td>
            <td><?php echo $data['transaction_recipient_address']; ?></td>
        </tr>
        <tr>
            <td>No. Telepon Penerima</td>
            <td><?php echo $data['transaction_recipient_phone']; ?></td>
        </tr>
    </table>
</div>
<br />
<div class="list">
    <table cellpadding="0" cellspacing="0">
        <tr>
            <th width="10">No.</th>
            <th width="50">Kode Produk</th>
            <th>Produk</th>
            <th width="80">Harga</th>
            <th width="10">BV</th>
            <th width="10">Quantity</th>
            <th width="100">Total BV</th>
        </tr>
        <?php
        if ($data != false) {
            $no = 1;
            foreach ($detail as $row) {
                $subtotal_price = $row['transaction_detail_bv'] * $row['transaction_detail_quantity'];
                echo '<tr>';
                echo '<td align="right">' . $no . '.</td>';
                echo '<td align="center">' . $row['transaction_detail_products_code'] . '</td>';
                echo '<td>' . $row['transaction_detail_products_name'] . '</td>';
                echo '<td align="right">' . number_format($row['transaction_detail_price']) . '</td>';
                echo '<td align="right">' . number_format($row['transaction_detail_bv']) . '</td>';
                echo '<td align="right">' . $row['transaction_detail_quantity'] . '</td>';
                echo '<td align="right">' . number_format($subtotal_price) . '</td>';
                echo '</tr>';
                
                $no++;
            }
            echo '<tr class="title">';
            echo '<td colspan="5" align="right"><strong>TOTAL</strong></td>';
            echo '<td align="right">' . number_format($data['transaction_total_quantity']) . '</td>';
            echo '<td align="right">' . number_format($data['total_bv']) . '</td>';
            echo '</tr>';
        } else {
            echo '<tr><td colspan="6" align="center">-----====-----</td></tr>';
        }
        ?>
    </table>
</div>